package one;

import java.util.ArrayList;
import java.util.List;

public class Test {
    public static void main(String[] args) {
        Test test = new Test();
        List<Dog> list1 = new ArrayList<>();
        test.sleep1(list1);
        List<Dog> list2 = new ArrayList<>();
        test.sleep2(list2);
        List<Dog> list3 = new ArrayList<>();
        test.sleep3(list3);
    }
    public void sleep1(List<? extends Animal> list){
        for (Object obj: list){
            System.out.println(obj);
        }
    }
    public void sleep2(List<? super Dog> list){
        for (Object obj: list){
            System.out.println(obj);
        }
    }
    public <E extends Animal> void sleep3(List<E> list){
        for (Object obj: list){
            System.out.println(obj);
        }
    }
}
